return null if returnFirstElement and no element