fixed an error where it would check the length of an object that didn't exist