Corrected program flow. Now it could not end without starting