fix compatibility with api less than 17 by backporting TextClock
more fixes