fixed issue with null objects