edit fn for adding js