Fixed error, and tested