add JS conversion funtion