move resize method so its available before use