Availability Profile retrieval issue

After changes in the mongodb schema the profiles were not retrieved correctly. This fixes the above problem.