fix bug for bean context function