change Nil reference to {} because javascript