updated user side functions to help prevent mysql injection issue