new resize function not working properly