canvas resize fix