dan fixed playeractions, i added error checks