quick fix, should be modified in a more robust way later