fix bug for finishing a session automatically & changing task in test mode