changed db commit to right position