added mistakes function as global variable