avoid NPE
edited source arts
code style