finally, seems to be working