extending assert and handling exit