Fixes submit method for database