adding right order into js file for function