Added returning and processing of commands