functions, exception handing updates