fixing resize bug