fixed bug with nulls