Adding navigation links and some error checking