management of canvas resize