added try-catch for debugging and fault tollerance