fixed a problem with reg