How to mark task as failed if frame doesn't exist?