add return -1 on failure