Fixed sql to work on postgres
fixed create attendee bug with submissions