fixed mistake where update_count not updated properly