added sockets  in the main activity and fixed the errors