fixed bugs with doctrine