added volatile keyword to global var shared between signal handler and main code
corrected misspelling (poll -> polling)