Added better handling