Fixed error when user has no profile
Merge branch 'Fix_index_unboundlocalerror' into develop