updated js with autogrow