added range support
added value null checks