Fixing to work with js engine as well