Refatored to ios 7