fixed bug with wrong calculation on iPad iOs7