Bug-4388 Disable database expansion when enabled throws Error 500

Signed-off-by: Chirayu Chiripal <chirayu.chiripal@gmail.com>
Merge pull request #1167 from D-storm/bug-4388

Bug-4388 Disable database expansion when enabled throws Error 500