fixed container resize logic