Added further checking & validation function