Fixed Error Checking