fixing few issues with error handeling