added final error catch