modified to use env port