improved error logging
added environment variables passing to process