init code for the client