fixed problem with invoice switching