ruby code works, javascript is still in debug