wrapped bash call to handle errors