added error logs