improve params filtering, closes #1776
Merge pull request #1777 from padrino/improve-params

improve params filtering, closes #1776