session_start() moved to a more suitable position