0.6.2 trim query and minor bug fix