use any? instead of count. Count seems to make a query and therefore wont work with entities not yet added to the db