add exceptions handling