Error checking code is wrong..