Solving problem with error