fixing the raising of errors