When I upload the program, it took long first then it says ''COM4 already in use try quiting other program may be using it''. I checked in Device manager it says under Ports (COM & LPT) that COM4 is assigned to Arduino Mega 2560 (COM4). I reconfirmed it by checking in Arduino IDE in Tools menu which says ''Serial Port -> COM4''. Thats very annoying. If somebody know the solution kindly let me know. Thanks for reading my problem.