changed setinterval to resize to save processing