fixed placement of require_login