fix bugs in apacher