Modify the functions scope from global to local
Fix #8: Add a function to handle client adding to the list