registration functional. Need to fix lifecycle