Handle whether datatype is list or atom