Added in better error detection at critical points
Added more to the dragon script to make it work with the backend