resize method to adaprive resize method change