fix environment capitalize function