Made modifications for null pointer and fixing issues with table column names