added error message to spin lock method