now setting the resolution automatically