changed to use beanName instead of name