implement resize functionality