add resize function and ui