I rechecked the code, the function should work properly event both update_size and update_max are true and update_size is cancelled out.