NullPointerException in removed attributes