Updated for the automatic resolution adjustment