Works correctly now