Fixed a silly mistake

The function was broken before