added field fail_reason, added inserting info into this field, added some data checks and redirects