keep alive on except in main loop