Fixed trigger casting bug