added benchmark,added null check