removed unused imports and added null check for literal datatype