fixing server; adding dynamic pin selection on server