fixed video rendering bugs, better error handling