Added some Excpetion handling