updated for nulls