switched to Yoda conditions to avoid null pointer