fixed the stuck resize bug