fixed nasty scoping bug when calling array.map in schedule. discovered while improving unit tests. yay ;)