updated for new static env stuff by james