beginTransaction and commitTransaction methods doesn't work coorect