bugfix next_period
make IP authorization work