update session for error in jquery