fix lifecycle of JS components