add seperate js functions