fix update logic and add more logging