bug fixes to setup env
bug fixes to setup env