fix item and activity database calls

there was no $database so the error call got changed to its respective
databases