fix coding standard
moving variables global to head
add new feature onSelectFirstResult