Better 404 JS implementation