Fix for location undefined bug in mocha