Put try clause inside server main loop