passing user & pass variables to function might help