fix use of global shape var