Added null check.
Unnecessary bean deleted.