bugfixed (some code not refactored correctly)