last changes and bug fixes