added custom exception handler and base initialisation