add  more robust implementation