Fixed error in source code based on Alex's feedback