key listener and flag problems

add capital p to key listener and remove thread stop while not-running.