Bug fixed for null values in the DB