fixed misplaced #endif