Fix deployment environment issue & add logging