fixed a bug in form fields creation sql
fixed a bug that prevents redirect to 404
small bug fixes