more flow control + some bug killing