Add error-handling for print_top and duplicate_top