Added throws fuctionallity