fix bar adapter crash problem