ssh works better when check is moved to the top