Trigger fix

Fixed the issue which caused an error whenever the triggers were enabled