fixed bug in gaylevel