added debug print to js