Added iOS5 compatibility