implemented wait command