added catch for eror