fix automatic screenshot bug