added fail logic