fix missing logic