Fix for JS exception