fixed a bug with hostname, added environ()