Changed navigation functions for better on ipad