fixed trap logic