preparing defenv