fix js errors in case management