Was the error in this function?