Added quit flag