Added onchange and onresize methods