Do exception handling and stuff