Added logging
Added extraction of exit code
Added quotes around password