made slight refactor. Was getting syntax error before.