bugfix filter molecules function