added check for record