fixed issue that applying a filter would introduce js errors