proper null-checks in toString