fixed initial resize bug