Fixed serialization problem for getting orders from the database