Fix bad access right exception