fixed a crazy if