Updated to make it work