Fixed error
Chaned implementation