fix the issues xoft pointed out