take into account resize