Fixed: works with database