adding try catch only to avoid timeout when arduino if off - for debug mode only
fixing bugs