add cancan and some code for cancan bug