Updated the correct version to have same code for client and server side
Changed logic to return a more correct value