stupid js mistake