creating a record and outputting alerts