fixed sql script to sync up with formanswer sequence