fixing upload and session (partially)