added edge case for nulls