Added foundation 5 compatiability