fixed issues with nulls