try adding exit function