program showing incorrect resize