added small sleep to avoid racecondition between layout change and renderer, which causes black borders