fixed issue handling of multiple records at once