Fixed typo, Added a try and except statement for the while loop also moved GPIO.cleanup() into except statement