Fixed return behaviour (refactoring needed)