get rid of "var self = this" pattern and fix bug in recordselector.