bug fix
function order fixed