Fixing META-236 ticket

Hi!
Please review the commit.And let me know if there are places to improve.
Thanks!