fix AP warning; remove unused variable

1. fix AP warning
2. remove unused variable