Added check on database