Replaced 'null' with '' in appendCaption()