made cost index function private
added test to null user