added exec 2>&1 to logging