fix the issue with resizing