added registration functiion