added returnElementOrNull