Fix bug in initial and run method
Dont use array.filter for performance issue