fixing bad code && adding the once codition
Adding trigger factory