fixed error raising bug