Fix that checks if $locals is array for model