JS fix for navigation error