fixed a bug, things were out of order.