Fixed small bug with logic

Fixed bug where the flow in the logic was interrupted.