fixed submit to database