Reverted my fix and applied the better one provided by mr_calvin. Thanks.