reg form fix, optimiztion