Solved the inconsistent behaviour problem