bugfixes for js and CRUD