Removed redundant require
Added logging for query and fixed null column values