adding smartresize feature