added runwith var
error handling and connecting
failed to commit