fix bugs and cancan is work correctly