Added Null Check and changed the Warning telling so
Removed some unused imports