Adding test  + further js changes