added depth to onStep