function to check for hanging functions