adding better resize functionality