fix wrapping bugs
fix step passing bug