adding try/catches for more robustness