Error checking for methods