change prototype to jquery function