fixing tests and scheduler