fix undefined error and sign