Fixed bad access bug