Bug fix in screenshot script