Improved splashscreen function