Fixing resize event