Fixed incorrect function