added extra handeling logic