correct resize bug