doctrine working properly with entities