trying to handle exceptions