added register controller
updated a check routine when an array is returned
include register controller in the markup