gpio handler check for 1023
gpio handler cleaner code