bugfix in download code. wrong context in an anonymous function.