Add debug flag for JS