Fixed error in database controller