simplified exit logic