Fixes #4, trims input queries on frontend