fixed bug with the help of @brixen and @txus