bug fix for NullPointerException in case of failure