fixed walking logic