Removed array cast because it was causing issues with other functions