added fail to appdelegate