Added collection hook, and moved submitted field to before insert hook