Added clearQueue to resize function