better rAF solution