bugfix and more method

handle error cases in a better way. Add display and checking method.