exceptions + evil codes in two functions