Change `ghosts` to an object.

The `ghosts` variable was incorrectly declared as an array.