when js library is loaded