Seems to be working correctly now