fixed compilation error and moved code for future use to registering part