Error checking and method fix