Add exeption handling