working on commiting to database