added logic for splash screen