put commands into function on serverside... I think it works

Signed-off-by: Miethop <miethpomail@yahoo.co.uk>