fixes and improvement