added funcion with bug