moved the init variable into the on key up function