replace NULL with NONE