Fix bug about method return null