Added getOrNull() function