Thank you for the reply. I figured that the arduino board was defective. New board is working fine now.