implemented callback on JS