Fixed issue with undefined promises wahey