Setting environment correctly