add_player ( pid , "richard" ) { :error , :max_players } A hidden race condition This seems to be working in the repl, but if you deployed this into production you may find that every once in a while a 5th or even 6th player will sneak in.