added to database fixed algo