added error handling and clearing play object ids